package com.haiyou.dc.netty.service;

import com.github.pagehelper.PageInfo;
import com.haiyou.common.base.BaseService;
import com.haiyou.dc.netty.chat.Message;
import com.haiyou.dc.netty.entity.ImChat;
import com.haiyou.dc.netty.entity.dto.ImChatDTO;
import com.haiyou.dc.netty.entity.dto.ImChatListDTO;
import com.haiyou.dc.netty.entity.vo.ImChatVO;

import java.util.Map;

/**
 * @author root
 * @date 2020-02-29 22:49:56
 */
public interface ImChatService extends BaseService<ImChat> {
    /**
     * 添加聊天记录
     * @param imChatDTO
     */
    ImChat saveChat(ImChatDTO imChatDTO);

    /**
     * 侦听聊天
     * @param message
     */
    ImChat listenerMessage(Message message);

    /**
     * 获取聊天记录
     * @param sender
     * @return
     */
    Map<String, Object> selectMessage(String sender);

    /**
     * 获取未读条数
     * @param sender
     * @param receiver
     * @return
     */
    Integer getUnreadCount(String sender,String receiver);

    /**
     * 获取聊天记录
     * @return
     */
    PageInfo<ImChatVO> queryChatList(ImChatListDTO imChatListDTO);
}